
<?php
$project = get_project_by_link($param[1]);
;
//Get project Images
$rs_img = get_project_images($project["id"]);
$have_img = false;	
$class_des = 2;	  
if($db->num_rows($rs_img) > 0) {
    $have_img = true;
    $class_des = "";
}
// GET Geo
$geo = get_arr_city($project["geo_id"]);
//=================================
// GET Member Info
//$member_info = get_member_info($project["user_id"]);
?>


<script language="javascript" type="text/javascript">


    function show_tab(mode)
    {
        $('#div_tab1').hide();
        $('#div_tab2').hide();
        $('#div_tab3').hide();

        var tab1  = document.getElementById('tab1');
        var tab2 = document.getElementById('tab2');
        var tab3  = document.getElementById('tab3');

        tab1.className = '';
        tab2.className = '';
        tab3.className = '';

        switch(mode)
        {
            case 1 : tab1.className = 'current'; $('#div_tab1').show(); break;
            case 2 : tab2.className = 'current'; $('#div_tab2').show(); break;
            case 3 : tab3.className = 'current'; $('#div_tab3').show(); break;
        }
    }
    function get_project_ajax(tab,page,mode){

        $.ajax({
            url: AJAX_PROCESS_URL+'get_project_'+mode+'/'+tab+'/'+page,
            type: 'GET',
            data: "",
            error: function(){
                //alert('error!');
            },
            success: function(data){

                $("#div_tab"+tab).html(data);

            }
        });

    }
</script>

<div  class="right_content_SBDS" >
    <div class="toplink"><img src="<?php echo SITE_IMAGES_URL; ?>/iconhome.gif" /><a href="#"><b>[Trang chủ]</b></a>&raquo;<a href="#">[Thông tin dự án]</a>&raquo;<a href="#" class="pagehere"><?php echo $project["cat_title"];?></a></div>
    <div class="top_san_BDS" style="height: 50px">
        <div class="top_san_BDS_l" >
            [Bạn đang xem tin tại]: <font class="textbold">[Việt Nam]</font> &raquo;  <span ><font class="textbold"><?php echo $geo["geo_title"];?></font> &raquo; <font style="color:blue;font-weight: bold "><?PHP ECHO $project["title"];?></font></span>



        </div>


    </div>
    <div class="Right_san_ct">    

        <div style="float:left;height:300px;padding:0px; margin:10px; border:1px #b1c4d5 solid;width: 710px!important;width: 690px;" id="mapcontainer"></div>
        <script language="javascript" type="text/javascript">
            $(function(){
                $("#mapcontainer").gMap({
                    controls: true,
                    scrollwheel: false,
                    icon: { image: "<?php echo SITE_IMAGES_URL; ?>/gmap_pin.png",iconsize: [20, 30],iconanchor: [12, 30],infowindowanchor: [12, 0] },
                    zoom: 16,
                    markers: [{
<?php if($project["map"]=='')echo "latitude: 21.028711, longitude: 105.852456";else echo $project["map"]; ?>,
                    html: "<div class=\"MiniPopup\"><span class=\"psptitle\"><?php echo limitWord(htmlentities_utf8($project["title"]),7);?></span><br><img src=\"<?php echo SITE_IMAGES_URL; ?>/start_yellow.gif\"><img src=\"<?php echo SITE_IMAGES_URL; ?>/start_yellow.gif\"><img src=\"<?php echo SITE_IMAGES_URL; ?>/start_yellow.gif\"><img src=\"<?php echo SITE_IMAGES_URL; ?>/start_yellow.gif\"><img src=\"<?php echo SITE_IMAGES_URL; ?>/start_yellow.gif\"><p class=\"Content\"><div class=\"imagemap\"\><img alt=\"picture\" id=\"pi\" class=\"Image\" src=\"<?php echo get_project_thumb($project['thumb'],'91-71');?>\"></div><br><b>[Chủ đầu tư]:</b>&nbsp;&nbsp;<?php echo $project["chudautu"];?><p><b>[Diện tích]:</b>&nbsp;&nbsp;<?php echo format_thousand($project["dientich"]);?></div>",popup: true}]
        });});



        </script>
        <div class="line_info2_slide" style="width:705px">
            <?php if($have_img) {
                ?>

            <div id="demo" style="overflow:hidden;position:relative; width: 95%; height: auto">
                <table border="0" align="left" cellpadding=0 bgcolor="#ffffff" cellspace="0">
                    <tr>
                        <td id="demo1" valign="top" width="1335">
                            <table border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr valign="top" bgcolor="#FFFFFF">
                                        <?php
                                        $i=0;
                                        while($rs=$db->fetch_array($rs_img)) {
                                            $i++;
                                            ?>
                                    <td align=middle>
                                        <table cellspacing=0 cellpadding=0 border=0 >
                                            <tr>
                                                <td align="center" style="padding: 0px 5px 0px 5px;">
                                                    <div id="gallery">
                                                        <a  href="<?php echo get_project_thumb($rs['image'],'257-256');?>">
                                                            <span></span>
                                                            <img class="thum_tv" style="width:120px;height: 90px"  src="<?php  echo get_property_thumb($rs['image'],'120-90');?>" <?php echo 'id="img_'.$i;?> alt="" title="" />
                                                        </a>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                            <?php
                                        }
                                        ?>
                                </tr>
                            </table>
                        </td>
                        <td id="demo2" valign="top" width="19">&nbsp;</td>
                    </tr>
                </table>

            </div>
                <?php if($db->num_rows($rs_img)>=5) {
                    ?>
            <script type="text/javascript" language="javascript">

                var td_demo = document.getElementById("demo");
                var td_demo1 = document.getElementById("demo1");
                var td_demo2 = document.getElementById("demo2");
                td_demo2.innerHTML = td_demo1.innerHTML;
                var demo_left = 0;
                var demo_width = td_demo1.offsetWidth;
                function Marquee()
                {
                    demo_left++;
                    if (demo_left>=demo_width)
                    {
                        demo_left-=demo_width;
                    }
                    td_demo.scrollLeft = demo_left;
                    //setTimeout("Marquee()", speed);
                }
                var speed = 50;
                var MyMar = setInterval ("Marquee()", speed);
                td_demo.onmouseover = function()
                {
                    clearInterval (MyMar) ;
                }
                td_demo.onmouseout = function()
                {
                    MyMar = setInterval ("Marquee()", speed);
                }
            </script>
        <?php
                }
            }
            ?>
        </div>
        <div style="margin-left: 20px;padding: 0px; text-align: left;" >
            <div style="width: 500px; float: left; font-weight: bold;font-size: 12px">
                <table cellspacing="0" cellpadding="5" border="0" width="100%" align="left">
                    <tr style="background-color: #e6ecf3;">
                        <td style="padding-left: 10px; width: 120px;">
                            [Chủ đầu tư]
                        </td>
                        <td align="center" style="width: 10px;">:</td>
                        <td style="margin-left: 10px;">
<?php echo $project["chudautu"];?>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left: 10px; width: 120px;">
                            [Đơn vị tư vấn]
                        </td>
                        <td align="center" style="width: 10px;">:</td>
                        <td style="margin-left: 10px;">
<?php echo $project["donvituvan"];?>
                        </td>
                    </tr>
                    <tr style="background-color: #e6ecf3;">
                        <td style="padding-left: 10px; width: 120px;">
                            [Đơn vị thi công]
                        </td>
                        <td align="center" style="width: 10px;">:</td>
                        <td style="margin-left: 10px;">
<?php echo $project["donvithicong"];?>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left: 10px; width: 120px;">
                            [Tổng đầu tư]
                        </td>
                        <td align="center" style="width: 10px;">:</td>
                        <td style="margin-left: 10px;">
<?php echo $project["tongdautu"];?>
                        </td>
                    </tr>
                    <tr style="background-color: #e6ecf3;">
                        <td style="padding-left: 10px; width: 120px;">
                            [Diện tích mặt bằng]
                        </td>
                        <td align="center" style="width: 10px;">:</td>
                        <td style="margin-left: 10px;">
<?php echo $project["dientich"];?>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top" style="padding-left: 10px; width: 120px;">
                            [Ngày khởi công]
                        </td>
                        <td align="center" style="width: 10px;">:</td>
                        <td style="margin-left: 10px;">
<?php echo $project["ngaykhoicong"];?>
                        </td>
                    </tr>
                    <tr style="background-color: #e6ecf3;">
                        <td style="padding-left: 10px; width: 120px;">
                            [Ngày hoàn thành]
                        </td>
                        <td align="center" style="width: 10px;">:</td>
                        <td style="margin-left: 10px;">
<?php echo $project["ngayhoanthanh"];?>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 10px;" colspan="3">&nbsp;</td>
                    </tr>
                </table>
            </div>
            <div  style="width: 158px; border: 1px solid rgb(130, 194, 233); background-color: #e6ecf3; float: left;margin-left: 20px">
                
                <div style="padding: 10px;" class="project">
                    <a class="thickbox" title="Gửi cho bạn bè" href="#TB_inline?height=450&width=600&inlineId=sendFriend">[Gửi bạn bè]</a><br><br>
                    <a href="javascript:window.print();">[In ra]</a><br><br>
                    <a href="javascript:history.back(-1);">[Quay lại]</a><br><br>
                    <script type="text/javascript">addthis_pub = 'gtcreal';</script>
                    <a onclick="return addthis_sendto()" onmouseout="addthis_close()" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" href="http://www.addthis.com/bookmark.php">
                        <img height="16" border="0" width="125" alt="" src="http://s9.addthis.com/button1-addthis.gif">
                    </a>
                    <script src="http://s7.addthis.com/js/152/addthis_widget.js" type="text/javascript"></script>
                </div>
            </div>
        </div>

        <div class="info_left<?php echo $class_des; ?>">
            <div style="font-weight: bold;font-size: 12px;padding:10px;">[MÔ TẢ VỀ DỰ ÁN]</div>
            <div style="font-size: 12px;padding-left: 20px">
<?php echo $project["content"];?>
            </div>      </div>

    </div>

<div id="sendFriend" class="folder-body00" style="display: none;height:350px" >
    <script type="text/javascript" language="javascript">
        function checkEmail(address) {
            var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
            if(reg.test(address) == false) {
                return false;
            }
            return true;
        }
        function submitSendFriend()
        {
            if($('#name').val()==''){
                $('#name').attr('border-color', 'red', 'style');
                $('#name').focus();
                return false;
            }
            if($('#email_to').val()==''){
                $('#email_to').attr('border-color', 'red', 'style');
                $('#email_to').focus();
                return false;
            }
            if(checkEmail($('#email_to').val())==false){
                alert('Bạn nhập email không đúng, xin vui lòng nhập lại!');
                $('#email_to').focus();
                return false;
            }
            if($('#title').val()==''){
                $('#title').attr('border-color', 'red', 'style');
                $('#title').focus();
                return false;
            }
            if($('#content').val()==''){
                $('#content').attr('border-color', 'red', 'style');
                $('#content').focus();
                return false;
            }

            $.ajax({
                url: AJAX_PROCESS_URL+'sendFiend',
                type: 'post',
                data: "name="+$('#name').val()+'&email_from='+$('#email_from').val()+'&email_to='+$('#email_to').val()+'&title='+$('#title').val()+'&content='+$('#content').val()+'&url='+window.location.href,
                error: function(){
                    alert('Connection error!');
                },
                success: function(data){
                    if(data=='die'){
                        alert('Error');
                    }
                    $('#TB_closeWindowButton').click()
                }
            });

        }


    </script>
<div class="line_dangtin" style="margin-left: 20px;font-weight: bold;margin-top: 20px;width: 97%">
        <div><?php echo $_SESSION['msgContact'];unset ($_SESSION['msgContact'])?></div>
        <form id="frmSendFriend" method="POST" onsubmit="">
            <ul>
                <li>
                    <div class="line_dt_l" style="width: 22%;">[Tên của bạn] <font color="#f87310">(*)</font></div>
                    <div class="line_dt_r"><input type="text" id="name" name="name" style="width: 80%;"></div>
                </li>
                <li>
                    <div class="line_dt_l" style="width: 24%;">[Email người nhận] <font color="#f87310">(*)</font></div>
                    <div class="line_dt_r">
                        <input type="text" id="email_to" name="email_to" style="width: 80%;"/>
                    </div>
                </li>
                <li>
                    <div class="line_dt_l" style="width: 22%;">[Tiêu đề] <font color="#f87310">(*)</font></div>
                    <div class="line_dt_r"><input type="text" style="width: 80%;" value="" id="title" name="title"></div>
                </li>
                <li>
                    <div class="line_dt_l" style="width: 22%;">[Nội dung] <font color="#f87310">(*)</font></div>
                    <div class="line_dt_r"><textarea id="content" name="content" rows="6" cols="20" style="width:80%;height: 100px;"></textarea></div>
                </li>
                <li >
                    <div class="line_dt_l" style="width: 22%;">&nbsp;</div>
                    <input type="hidden" name="post_contact" value="okie" />
                    <div class="line_dt_r"><img style="cursor: pointer" src="/images/btn_send.gif" onclick="submitSendFriend();" name="sendFriendSubmit"/></div>
                </li>


            </ul>
        </form>
    </div>
</div>

<!--[if IE 7]><!-->

<!--<![endif]-->
<!--[if lte IE 6]>

<![endif]-->